package com.hsd.entity;

import javax.persistence.*;

@Entity
@Table(name = "t_user", schema = "wu")
public class User {
    private int uId;
    private String uName;
    private String uAcc;
    private String uPass;

    public User(){}

    public User(String uName, String uAcc, String uPass) {
        this.uName = uName;
        this.uAcc = uAcc;
        this.uPass = uPass;
    }

    @Id
    @Column(name = "u_id")
    public int getuId() {
        return uId;
    }

    public void setuId(int uId) {
        this.uId = uId;
    }

    @Basic
    @Column(name = "u_name")
    public String getuName() {
        return uName;
    }

    public void setuName(String uName) {
        this.uName = uName;
    }

    @Basic
    @Column(name = "u_acc")
    public String getuAcc() {
        return uAcc;
    }

    public void setuAcc(String uAcc) {
        this.uAcc = uAcc;
    }

    @Basic
    @Column(name = "u_pass")
    public String getuPass() {
        return uPass;
    }

    public void setuPass(String uPass) {
        this.uPass = uPass;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        User user = (User) o;

        if (uId != user.uId) return false;
        if (uName != null ? !uName.equals(user.uName) : user.uName != null) return false;
        if (uAcc != null ? !uAcc.equals(user.uAcc) : user.uAcc != null) return false;
        if (uPass != null ? !uPass.equals(user.uPass) : user.uPass != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = uId;
        result = 31 * result + (uName != null ? uName.hashCode() : 0);
        result = 31 * result + (uAcc != null ? uAcc.hashCode() : 0);
        result = 31 * result + (uPass != null ? uPass.hashCode() : 0);
        return result;
    }
}
